package org.rcgwt.client.model;

import org.rcgwt.generators.ReflectedGenerator;

import com.google.gwt.core.client.GWT;

/**
 * Reflection factory. Create the reflected wrappers on demand.
 * 
 * The actual class will be generated at compile time by the reflection
 * generator.
 * 
 * @see ReflectedGenerator
 * 
 * @author Didier MOISE
 */
public abstract class ReflectedFactory {
    /**
     * Singleton NOTE : The GWT.create(ReflectedFactory.class) will trigger the
     * ReflectedGenerator at compile time.
     */
    private static ReflectedFactory instance = (ReflectedFactory) GWT
            .create(ReflectedFactory.class);

    /**
     * @return Reflection factory singleton.
     */
    public static ReflectedFactory getInstance() {
        return instance;
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.vedana.rcgwt.client.model.IReflectedFactory#createReflected(java.
     * lang.Object)
     */
    public abstract <T> Reflected<T> createReflected(T obj);

    public abstract BeanProperty[] getBeanProperties(String className);
}
